[PATCH] detect/alert: check alert queue capacity before expanding
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 5 Jan 2026 13:57:11 +0000 (19:27 +0530)
committerAndreas Dolp <dev@andreas-dolp.de>
Thu, 23 Apr 2026 05:14:21 +0000 (07:14 +0200)
commit711d4662c141a0e419adddc5eab73a3a755ca680
tree966a08b97630a7e0c27579c1f0336322a8594019
parentea5927d0735f7520db6425c636c70a414ee7fcae
[PATCH] detect/alert: check alert queue capacity before expanding

So far, the alert queue was expanded by doubling in size w/o any
boundary checks in place. This led to situations where doubling
the alert_queue_capacity meant overflow of the very same value
stored in det_ctx.
This led to heap-use-after-free in some conditions where
det_ctx->alert_queue_capacity overflowed.

Fix this by capping the max of alert_queue_capacity by checking if its
expansion could result in an overflow.

Security 8190

(cherry picked from commit ac1eb394181530430fb7262969f423a1bf8f209b)

Origin: upstream, https://github.com/OISF/suricata/commit/5789a3d3760dbf33d93fc56c27bd9529e5bdc8f2.patch
Bug: https://redmine.openinfosecfoundation.org/issues/8190
Subject: Upstream fix for CVE-2026-22264

Gbp-Pq: Name CVE-2026-22264.patch
src/detect-engine-alert.c